// reduces
import {ADD_PERSON}from '../constant'
export default function personReducer(preState = [{name:'carlos',age:25,id:0}], action) {
  console.log("countReducer", preState, action);
  const { data, type } = action;
//   匹配actions里面的
  switch (type) {
    case ADD_PERSON:
      // 有return就不用break
      return [data,...preState];
    default:
      return preState;
  }
}

